package com.nowcoder.community.entity;/**
 * 功能描述
 *
 * @author 21775
 * @date 2022/09/24  20:35
 */

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;

/**
 *@ClassName Event
 *@Description TODO 事件
 *@Author 21775
 *@Date 2022/9/24 20:35
 *@Version 1.0
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class Event {
    private String topic;
    private int userId;
    private int entityId;
    private int entityType;
    private int entityUserId;
    private Map<String,Object> data=new HashMap<>();

    public Event setTopic(String topic) {
        this.topic = topic;
        return this;
    }

    public Event setUserId(int userId) {
        this.userId = userId;
        return this;
    }

    public Event setEntityId(int entityId) {
        this.entityId = entityId;
        return this;
    }

    public Event setEntityType(int entityType) {
        this.entityType = entityType;
        return this;
    }

    public Event setEntityUserId(int entityUserId) {
        this.entityUserId = entityUserId;
        return this;
    }

    public Event setData(String key,Object value) {
        this.data.put(key,value);
        return this;
    }
}
